read -p "输入节点名称[别用中文][示例：yanhui001]:" nodename
read -p "输入验证节点ip端口[建议${ip}:6180]:" yuning




curl -o get-docker.sh https://get.docker.com && sh get-docker.sh && rm -f get-docker.sh
systemctl start docker
systemctl enable docker
chmod +x docker-compose-Linux-x86_64 && cp docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
mkdir -p ~/aptos-node/testnet
cp ./*.yaml ~/aptos-node/testnet && cd ~/aptos-node/testnet ;
docker run --rm -v /root/aptos-node/testnet:/data/aptos-cli jiangydev/aptos-cli:v0.1.1 aptos genesis generate-keys --output-dir /data/aptos-cli ;
docker run --rm -v /root/aptos-node/testnet:/data/aptos-cli jiangydev/aptos-cli:v0.1.1 aptos genesis set-validator-configuration --keys-dir /data/aptos-cli --local-repository-dir /data/aptos-cli --username $nodename --validator-host $yuning:6180 --full-node-host $yuning:6182
bash -c "cat > layout.yaml" <<EOF
---
root_key: "0x5243ca72b0766d9e9cbf2debf6153443b01a1e0e6d086c7ea206eaf6f8043956"
users:
  - $nodename
chain_id: 23
EOF
docker run --rm -v /root/aptos-node/testnet:/data/aptos-cli jiangydev/aptos-cli:v0.1.1 sh -c "rm -rf /data/aptos-cli/genesis.blob && rm -rf /data/aptos-cli/waypoint.txt && rm -rf /data/aptos-cli/framework && cp -r /framework /data/aptos-cli && aptos genesis generate-genesis --local-repository-dir /data/aptos-cli --output-dir /data/aptos-cli && rm -rf /data/aptos-cli/framework" ;
docker-compose up -d
cat $nodename.yaml

